package demo.serialport.bundle;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import demo.serialport.bundle.SerialPortBundle.SerialPortRunnable; 


public class Activator implements BundleActivator {
  
  public void start(BundleContext context) throws Exception {
	  System.out.println("serial port bundle started!");
	  SerialPortBundle.RunningFlag = true;
	  new Thread(new SerialPortRunnable()).start();
  }

  
  public void stop(BundleContext context) throws Exception {
	  System.out.println("serial port bundle stop!"); 
	  SerialPortBundle.RunningFlag = false;
	  SerialPortBundle.closePort();
  }
  
}